package group.rober.runtime.holder;

import java.util.Date;

/**
 * 日期保持器，把当前系统时间绑定到线程上
 */
public abstract class DateHolder {
    private static final ThreadLocal<Date> dateHolder = new ThreadLocal<Date>();
    public static Date getDate(){
        return dateHolder.get();
    }
    public static void setDate(Date date){
        dateHolder.set(date);
    }

    public static void clear() {
        dateHolder.remove();
    }
}
